/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package java1;



/**
 *
 * @author Yu
 */
public class NewMain {
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
       java.util.HashMap<Integer, Integer> map = new java.util.HashMap<Integer, Integer>();
       java.util.Scanner sc = new java.util.Scanner(System.in);
       System.out.print("請輸入數字的數量");
       int num = sc.nextInt();
       for(int i=0 ; i < num ; i++){
           System.out.print("請輸入數字:");
           int tmp = sc.nextInt();
           if( map.get(tmp) ==null){
               map.put(tmp, 1);
           }else{
               map.put(tmp , map.get(tmp)+1 );
           }
       }
       java.util.Iterator<Integer> it =  map.keySet().iterator();
       while(it.hasNext()){
           Integer key =  it.next();
           Integer value = map.get(key);
           System.out.println(key+":"+value);
       }
    }
    
}